<?php

namespace common\models;

use Yii;
use yii\base\Model;

/**
 * order检查
 */
class OrderForm extends Model {
    public $name;
    public $contact;
    public $email;
    public $phone;
    public $useFund;
    public $useProtect;
    public $rental;
    public $message;
    public $tripId;
    public $cabinId;
    public $oneself;
    public $course;

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [
                [
                    'name',
                    'contact',
                    'email',
                    'phone',
                    'cabinId',
                    'tripId',
                ],
                'required',
            ],
            [
                'email',
                'email'
            ],
            [
                [
                    'message',
                    'phone',
                    'rental',
                    'course'
                ],
                'string',
            ],
            [
                [
                    'cabinId',
                    'tripId',
                ],
                'integer'
            ],
            [
                [
                    'useFund',
                    'useProtect',
                    'oneself'
                ],
                'boolean',
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'email' => '邮箱',
            'oneself' => '独占',
            'phone' => '手机号码',
        ];
    }
}
